﻿using eSSP_example.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Threading.Tasks;

namespace eSSP_example.Interface
{
    [ServiceContract(Name = "CashGenicService")]
    public interface ICashGenic
    {
        /// <summary>
        /// Token
        /// </summary>
        /// <param name="grant_type"></param>
        /// <param name="user_name"></param>
        /// <param name="pasword"></param>
        /// <returns></returns>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "token?grant_type={grant_type}&username={username}&password={password}", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        TokenResponse getToken(string grant_type, string username, string password);

        /// <summary>
        /// System
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        [WebGet(UriTemplate = "system", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        ApiSystemInfoResponse getSystemInfo();

        /// <summary>
        ///     Session
        /// </summary>
        [OperationContract]
        [WebInvoke(Method = "POST", UriTemplate = "session", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        ApiPayRequestResponse doSession();

        /// <summary>
        ///     status
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        [WebGet(UriTemplate = "status", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
        ApiStatusResponse getStatus();
    }
}
